package com.wing.warehouse.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wing.warehouse.model.entity.WarehouseFactoryShelfSpaceEntity;
import com.wing.warehouse.model.entity.WarehouseFactoryShelfSpaceVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 仓库货架货位-Dao
 *
 * @author
 */
@Mapper
public interface WarehouseFactoryShelfSpaceDao extends BaseMapper<WarehouseFactoryShelfSpaceEntity> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<WarehouseFactoryShelfSpaceVO> list4app(@Param("params") Map<String, Object> params);

    List<WarehouseFactoryShelfSpaceVO> selectFactoryCount(@Param("ids")List<Long> ids);

    List<WarehouseFactoryShelfSpaceVO> selectFactoryList();

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<WarehouseFactoryShelfSpaceVO> list4app(@Param("page") Page<WarehouseFactoryShelfSpaceVO> page, @Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    WarehouseFactoryShelfSpaceVO get4appById(Long id);

    int disableByShelfId(@Param("shelfId") Long shelfId);

    int updateShelfSpaceById(WarehouseFactoryShelfSpaceEntity warehouseShelfSpace);

    WarehouseFactoryShelfSpaceVO findByCode(String code);

    /**
     * 查询采购入库产品库位
     * @param skuCode
     * @param warehouseId
     * @return
     */
    List<WarehouseFactoryShelfSpaceVO> getShelfSpace(@Param("skuCode") String skuCode, @Param("warehouseId") Long warehouseId);

    WarehouseFactoryShelfSpaceEntity selectLastNumByPrefix(@Param("prefix") String prefix, @Param("length") Integer length ,@Param("suffix") Integer suffix);
}
